import request from '@/utils/request'

// 查询外协计划列表
export function listPlan(query) {
  return request({
    url: '/pro/outsourcingplan/list',
    method: 'get',
    params: query
  })
}

// 查询外协计划详细
export function getPlan(planId) {
  return request({
    url: '/pro/outsourcingplan/' + planId,
    method: 'get'
  })
}

// 新增外协计划
export function addPlan(data) {
  return request({
    url: '/pro/outsourcingplan',
    method: 'post',
    data: data
  })
}
// 确认外协计划
export function approvePlan(data) {
  return request({
    url: '/pro/outsourcingplan/approve',
    method: 'post',
    data: data
  })
}
// 修改外协计划
export function updatePlan(data) {
  return request({
    url: '/pro/outsourcingplan',
    method: 'put',
    data: data
  })
}
// 暂停外协计划
export function pausePlan(planId) {
  return request({
    url: '/pro/outsourcingplan/pause/'+planId,
    method: 'put'
  })
}
// 重启外协计划
export function resumePlan(planId) {
  return request({
    url: '/pro/outsourcingplan/resume/'+planId,
    method: 'put'
  })
}

// 删除外协计划
export function delPlan(planId) {
  return request({
    url: '/pro/outsourcingplan/' + planId,
    method: 'delete'
  })
}

// 查询外协计划line列表
export function listLine(query) {
  return request({
    url: '/pro/outsourcingplanline/list',
    method: 'get',
    params: query
  })
}

// 查询外协计划line详细
export function getLine(id) {
  return request({
    url: '/pro/outsourcingplanline/' + id,
    method: 'get'
  })
}

// 新增外协计划line
export function addLine(data) {
  return request({
    url: '/pro/outsourcingplanline',
    method: 'post',
    data: data
  })
}

// 修改外协计划line
export function updateLine(data) {
  return request({
    url: '/pro/outsourcingplanline',
    method: 'put',
    data: data
  })
}

// 删除外协计划line
export function delLine(id) {
  return request({
    url: '/pro/outsourcingplanline/' + id,
    method: 'delete'
  })
}
export function getPlanProductList(query) {
  return request({
    url: '/pro/outsourcingplanline/planProductList',
    method: 'get',
    params: query
  })
}
export function transformToOutsource(data) {
  return request({
    url: '/pro/outsourcingplan/transformToOutsource',
    method: 'post',
    data: data
  })
}


